<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	
		<title>中诚信资讯 | 权限管理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=7" />
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
        <script type="text/javascript" src="<%=path %>/js/ui.js"></script>
		<link id="editCss" rel="stylesheet" type="text/css" href="<%=path %>/css/style.css" />
		<style type="text/css">
		.login{/*background:url(<%=path %>/images/login_bg.gif) repeat-x;*/ background-color:#3b0000;}
		.loginBox{width:916px;height:560px;background:url(<%=path %>/images/login_redbg2_pic.jpg) center no-repeat;position:relative;margin:0 auto;}
		.loginBox ul li{ display:inline;float:left;}
		.loginBox input,.loginBox a{position:absolute;}
		.loginBox input.writeText{border:0px #ff0000 solid;background:none;color:#FFF;width:159px;height:20px;line-height:20px;left:420px;top:263px;}
		.loginBox input.passWord{border:0px #ff0000 solid;background:none;color:#FFF;width:159px;height:20px;line-height:20px;left:420px;top:297px;}
		.loginBox input.checkbox{left:413px;top:334px;}
		.loginBox a.btnLogin{width:65px;height:54px;left:595px;top:263px;background: url(<%=path %>/images/btn_login.gif) no-repeat ;}	
		.loginBox a.btnLogin:hover{width:65px;height:54px;left:595px;top:263px;background: url(<%=path %>/images/btn_login_s.gif) no-repeat ;}	
		</style> 
    	<script type="text/javascript">
    		function login(){
    			var form = document.getElementById("myform");
    			form.submit();
    		}
    		
            // 按下回车后出发此事件   
		    function enterPress(e) {  
		        if (e.keyCode == 13) {   
		            doSubmit();   
		        }   
		    }   

	        function fox()
	        {
			    document.getElementById("wordx").focus();
			}
			
			// 表单提交   
		    function doSubmit() { 
		          var user=document.getElementById("wordx").value;
		          var pass=document.getElementById("wordx1").value;
		          var form = document.getElementById("myform");
		          if (user == "") {   
		            alert("请输入账号！");  
		            document.getElementById("wordx").focus();
		            return false;   
		        } else if( pass== "") {  
		            alert("请输入密码！");   
		            document.getElementById("wordx1").focus();
		            return false;  
		        }else{
		           form.submit();
		        }
		    }   
					
        
    	</script>
 	</head>
 	
 <%
// 清除session
Enumeration list = session.getAttributeNames();
while (list.hasMoreElements()) {
    session.removeAttribute(list.nextElement().toString());
}
%>
 
<body class="login" onload="fox()">
<div class="loginBox">

	<form id="myform" name="myform" action="<%=path %>/servlet/login/login.do" method="post" >
	<%
		long sessTimeStamp = System.currentTimeMillis();
	 %>
	<input name="session_timestamp" type="hidden" value="<%=sessTimeStamp %>" />
	
	<input name="userName" type="text" class="writeText" value="" id="wordx" onkeydown="enterPress(event);"/>
	<input name="password" maxlength="16" type="password" class="passWord" value="" id="wordx1" onkeydown="enterPress(event);"/>
	<a href="javascript:login();" class="btnLogin"></a>
  
	</form>
</div>
</body>
</html>
